#############################################################
# Makefile for server library.
# HOW TO USE: See the test, logtest.cpp
#           : make & run the logtest and view the log
#############################################################
CC = g++
CC_FLAG = -D_NOMNG -D_FILELINE
AR = ar

INC = 
LIB = -lpthread -L./ -lsvrtool

PRG = libsvrtool.a
OBJ = Log.o

TEST = logtest
TESTOBJ = logtest.o

all:$(PRG) $(TEST)

$(PRG):$(OBJ)
	${AR} rv ${PRG} $?

$(TEST):$(TESTOBJ)
	$(CC) $(CC_FLAG) -o $@ $(TESTOBJ) $(LIB)

.SUFFIXES: .c .o .cpp
.cpp.o:
	$(CC) $(CC_FLAG) $(INC) -c $*.cpp -o $*.o

.PRONY:clean
clean:
	@echo "Removing linked and compiled files......"
	rm -f $(OBJ) $(PRG) $(TEST) $(TESTOBJ)
